/*
 * 1218. 成绩等级
 * 实现一个学生的类 Student. 包含如下的成员函数和方法：
 * 两个公有成员name和score。分别是字符串类型和整数类型。
 * 一个构造函数，接受一个参数name。
 * 一个公有成员函数getLevel() 返回学生的成绩等级（一个字符）。
 * https://www.lintcode.com/problem/student-level/description
 * 
 * 等级表如下：
 * A: score >= 90
 * B: score >= 80 and < 90
 * C: score >= 60 and < 80
 * D: score < 60
 * 
 * 样例
 * Java:
 * Student student = new Student("Zuck");
 * student.score = 10;
 * student.getLevel(); // should be 'D'
 * student.score = 60;
 * student.getLevel(); // should be 'C'
 * 
 * Python:
 * student = Student("Zuck")
 * student.score = 10
 * student.getLevel() # should be 'D'
 * student.score = 60
 * student.getLevel() # should be 'C'
 * 
 * 2018.06.09 @jeyming
 */
package student_level_1128;

class Student {
    /**
     * Declare two public attributes name(string) and score(int).
     */
    // write your code here
    public String name;
    public int score;
    
    /**
     * Declare a constructor expect a name as a parameter.
     */
    // write your code here
    Student(String name){
        this.name = name;
    }
    
    /**
     * Declare a public method `getLevel` to get the level(char) of this student.
     */
    // write your code here
    public char getLevel(){
        if(this.score >= 90){
            return 'A';
        } else if((this.score >= 80) && (this.score < 90)){
            return 'B';
        } else if((this.score >= 60) && (this.score < 80)){
            return 'C';
        } else {
            return 'D';
        }
    }
}
public class Student_level_1228 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
